import java.awt.Color;
import java.awt.Font;
import java.io.Serializable;

import javax.swing.KeyStroke;

public class Configuration implements Serializable {
	private static Configuration instance;
	public String gapLibraryPath;
	public String name, windowTitle = "Quivers 1.5";
	public String defaultQuiverName = "q", defaultArrowName = "z",
			defaultRepresentationName = "r";
	public double windowWidth = 800, windowHeight = 600;
	public Color backgroundColor = Color.white;
	public int undoSize = 50;
	public boolean autoArrangeQuiver = false;
	public int arrangeSteps = 100;
	public boolean representationMode = true;

	// labels
	public boolean showLabels = true;
	public Font labelFont = new Font("Helvetica", Font.PLAIN, 14);
	public Color labelColor = Color.black;

	// nodes
	public double nodeRadius = 7, visibleNodeRadius = 3;
	public Color nodeColor = Color.black, hoveredNodeColor = Color.orange,
			heldNodeColor = Color.orange, selectedNodeColor = Color.black,
			indicatedNodeColor = Color.orange, highlightedNodeColor = Color.cyan,
            relationSelectedNodeColor = Color.green;

	// arrow
	public double arrowHeadAngle = 20 * Math.PI / 180, arrowHeadLength = 13,
			arrowLoopSize = 60, arrowLoopAngle = Math.PI / 4,
			arrowSpacing = 15, arrowLabelSpacing = 2, arrowWidth = 10,
			visibleArrowWidth = 1, bentArrowAngle = 60 * Math.PI / 180;
	public boolean bentBidirectionalArrows = false;
	public Color arrowColor = Color.black, selectedArrowColor = Color.orange,
            relationSelectedArrowColor = Color.green;

	// grid
	public boolean gridVisible = true;
	public double gridSize = 20;
	public Color gridColor = Color.lightGray;

	// automatic arranging
	public int autoArrangeUpdateDelay = 100;
	public double preferredNodeDistance = 100, hookesConstant = 0.3;

	// keys
	public KeyStroke undoKey = KeyStroke.getKeyStroke("control Z");
	public KeyStroke redoKey = KeyStroke.getKeyStroke("control shift Z");
	public KeyStroke clearQuiverKey = KeyStroke.getKeyStroke("control C");
	public KeyStroke newQuiverKey = KeyStroke.getKeyStroke("control T");
	public KeyStroke renameQuiverKey = KeyStroke.getKeyStroke("control R");
	public KeyStroke closeQuiverKey = KeyStroke.getKeyStroke("control W");
	public KeyStroke nextQuiverKey = KeyStroke.getKeyStroke("control TAB");
	public KeyStroke prevQuiverKey = KeyStroke
			.getKeyStroke("control shift TAB");
	public KeyStroke snapKey = KeyStroke.getKeyStroke("control H");
	public KeyStroke arrangeKey = KeyStroke.getKeyStroke("control A");
    public KeyStroke deleteKey = KeyStroke.getKeyStroke("DELETE");


    public KeyStroke openQuiverKey = KeyStroke.getKeyStroke("control O");
    public KeyStroke openQuiverSessionKey = KeyStroke.getKeyStroke("control shift O");
    public KeyStroke saveQuiverKey = KeyStroke.getKeyStroke("control S");
    public KeyStroke saveQuiverSessionKey = KeyStroke.getKeyStroke("control shift S");

	// GAP interface
	public Font gapInterfaceInputFont = new Font(Font.MONOSPACED, Font.PLAIN,
			12);
	public Font gapInterfaceOutputFont = new Font(Font.MONOSPACED, Font.PLAIN,
			12);

	private Configuration() {
	}

	public static Configuration getDefaultConfiguration() {
		if (instance == null) {
			instance = new Configuration();
		}
		return instance;
	}
}